package com.qf.juc.demo.inject;

import java.lang.reflect.InvocationTargetException;

public class Demo1 {

    void test(){
        System.out.println("test11");
    }

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {

        Demo1 demo1 = new Demo1();
        Class<? extends Demo1> aClass1 = demo1.getClass();

        Class aClass = Class.forName("com.qf.juc.demo.inject.Demo1");
        Object o = aClass.newInstance();
        Demo1 demo2 = (Demo1) o;
//        demo2.test();

        Demo1 demo11 = Demo1.class.newInstance();

        System.err.println(demo11==o);

        System.err.println(demo1==demo2);

    }

}
